import 'package:flutter/material.dart';

main() {
  runApp(BottonsApp());
}

class BottonsApp extends StatefulWidget {
  const BottonsApp({Key? key}) : super(key: key);

  @override
  _BottonsAppState createState() => _BottonsAppState();
}

class _BottonsAppState extends State<BottonsApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: BottonsView(),
      ),
    );
  }
}

class BottonsView extends StatefulWidget {
  const BottonsView({Key? key}) : super(key: key);

  @override
  _BottonsViewState createState() => _BottonsViewState();
}

class _BottonsViewState extends State<BottonsView> {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        SizedBox(
          height: 100,
        ),
        ElevatedButton(
          onPressed: () {},
          child: Text('按钮'),
        ),
        SizedBox(
          height: 10,
        ),
        RaisedButton(
          onPressed: () {},
          elevation: 10,
        ),
        SizedBox(
          height: 10,
        ),
        ElevatedButton(
          onPressed: () {},
          child: Text(
            '普通按钮',
            style: TextStyle(color: Colors.black),
          ),
          style: ButtonStyle(
              backgroundColor: MaterialStateProperty.all(Colors.grey)),
        ),
        ElevatedButton.icon(
            onPressed: () {}, icon: Icon(Icons.search), label: Text('搜索')),
        Row(
          children: [
            Expanded(
                child: Container(
              child: ElevatedButton(onPressed: () {}, child: Text('宽度')),
              height: 50,
              margin: EdgeInsets.all(20),
            ))
          ],
        ),
        ElevatedButton(
          onPressed: () {},
          child: Text('阴影按钮'),
          style: ButtonStyle(elevation: MaterialStateProperty.all(10)),
        ),
        ElevatedButton(
          onPressed: () {},
          child: Text('圆角图片'),
          style: ButtonStyle(
            shape: MaterialStateProperty.all(StadiumBorder()),
          ),
        ),
        ElevatedButton(
            onPressed: () {},
            child: Text('圆形按钮'),
            style: ButtonStyle(
                shape: MaterialStateProperty.all(RoundedRectangleBorder(
                    // side:
                    // BorderSide(width: 1)
                    borderRadius: BorderRadius.circular(100))))),
        Container(
          child: ElevatedButton(
            onPressed: () {},
            child: Text('圆形'),
            style: ButtonStyle(
                shape: MaterialStateProperty.all(CircleBorder(
                    side: BorderSide(
              style: BorderStyle.none,
            )))),
          ),
          height: 100,
        ),

        OutlinedButton(onPressed: (){}, child: Text('边框的按钮'), style: ButtonStyle(
          backgroundColor: MaterialStateProperty.all(Colors.grey),
          foregroundColor: MaterialStateProperty.all(Colors.black),
          side: MaterialStateProperty.all(BorderSide(
            width: 1,
            color: Colors.red
          ))

        ),)
        ,
        Container(
          height: 100,
          child: ElevatedButton(onPressed: () {}, child: Text('哈哈'), style: ButtonStyle(

              shape:MaterialStateProperty.all(CircleBorder())
              // shape:MaterialStateProperty.all(RoundedRectangleBorder())
              // shape:MaterialStateProperty.all(StadiumBorder())

          ),),
        )

      ],
    );
  }
}
